$(document).ready(function () {
	
    AutoScroll("#js-up");
    var timer = setInterval('AutoScroll("#js-up")',1500);
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
    	component.jobMobile = unescape(r[2]);    	
    } else {
    	component.jobMobile = null;
    }
    var reg = new RegExp("(^|&)jobNumber=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
    	component.jobNumber = unescape(r[2]);
    	
    } else {
    	component.jobNumber = null;
    }
    var reg = new RegExp("(^|&)zzdchannel=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
    	component.zzdChannel = unescape(r[2]);
    	
    } else {
    	component.zzdChannel = null;
    } 
})

function AutoScroll(obj){
  var timer;
  var li = $("#js-up").find("li");

  if(li.length == 1) {
    clearInterval(timer);
  }else {
    $(obj).find("ul:first").animate({ 
      marginTop:"-40px" 
    },1200,function(){ 
      $(this).css({marginTop:"0px"}).find("li:first").appendTo(this); 
    }); 
  }
}


/**
 * 2016-02-29
 * 自选套餐触版改版
 */
window.onload = function () {
    //插码加载中 modify by Wmerake 2016-06-06
    Webtrends.multiTrack({
        args: {"WT.si_n": "ZXTC", "WT.si_x": "20","WT.mobile" : $("#mobile").val()}
    });

    $(".radio").on('click', function () {
        if (!($(this).hasClass('disabled'))) {
            $(this).toggleClass('cur');
        }
    });



}
var component = {
		jobMobile : "",//推荐人号码
	    jobNumber : "",//推荐人工号
	    zzdChannel: "",//掌中店标志     
    cancelConfire: function () {
        //插码点击一次确认按钮 modify by Wmerake 2016-06-06
        Webtrends.multiTrack({
            args: {"WT.si_n": "ZXTC", "WT.si_s": "", "WT.si_x": "21","WT.mobile" : $("#mobile").val()}
        });
        htmlalldata = "";
        valueLL = "";
        valueTH = "";
        valueDX = "";
        valueCX = "";
        timestp = 0;//用户区分是否选择了数据业务(短信以及彩信)
        var phonecallValSZ = $("input:radio[name='sel-localyy']:checked").val();
        /*
         * 区分是否选择的是苏州通话语音包
         */
        if (phonecallValSZ != "" && phonecallValSZ != undefined) {
            /*选择了苏州语音包*/
            /*必选*/
            var phonedataObj = $("input:radio[name='sel-ll']:checked");

            var phonedataVal = $("input:radio[name='sel-ll']:checked").val();
            if (phonedataVal != "" && phonedataVal != undefined) {
                var codeLL = phonedataVal.split('-')[0];//流量编码
                var priceLL = phonedataVal.split('-')[1];//流量价格
                valueLL = phonedataObj.parent().find("input[name=vlauehide]").val();
                htmlalldata += "<div class='group-name clearfix' name='divbeforeLL'>";
                htmlalldata += "<input type='hidden' value='" + codeLL + "' name='divbeforeLL'>";
                htmlalldata += "<p class='name'>流量：</p>";
                htmlalldata += "<p class='name-text'>" + valueLL + "</p>";
                htmlalldata += "<span>" + priceLL + "元/月</span>";
                htmlalldata += "</div>";
                if (phonedataObj.parent().find("p").hasClass("hui-item")) {
                	htmlalldata += "<div class='group-name clearfix' name='divbeforeYH'>";
                    htmlalldata += "<p class='jiazeng'>加赠</p>";
                    htmlalldata += "<p class='name-text' style='line-height: 20px;'>2017优惠计划"+ valueLL +"省内通用流量+3G省内咪咕视频流量</p>";
                    htmlalldata += "<span>0元/月</span>";
                    htmlalldata += "</div>";
				}
            } else {
                $("#remindid").show();
                return false;
            }


            //苏州特殊
            var phonecallObjSZ = $("input:radio[name='sel-localyy']:checked");
            var phonecallValSZ = $("input:radio[name='sel-localyy']:checked").val();
            if (phonecallValSZ != "" && phonecallValSZ != undefined) {
                var codeTH = phonecallValSZ.split('-')[0];//通话编码
                var priceTH = phonecallValSZ.split('-')[1];//通话价格
                valueTH = phonecallObjSZ.parent().find("input[name=vlauehide]").val();
                //针对苏州的200分钟18元
                if (codeTH == "2000007040") {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeTH' value='" + codeTH + "'>";
                    htmlalldata += "<input type='hidden' value='" + codeTH + "' name='divbeforeTH'>";
                    htmlalldata += "<p class='name'>语音：</p>";
                    htmlalldata += "<p class='name-text'>200分钟</p>";
                    htmlalldata += "<span>" + priceTH + "元/月</span>";
                    htmlalldata += "</div>";


                    //针对苏州的400分钟28元
                } else if (codeTH == "2000007041") {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeTH' value='" + codeTH + "'>";
                    htmlalldata += "<input type='hidden' value='" + codeTH + "' name='divbeforeTH'>";
                    htmlalldata += "<p class='name'>语音：</p>";
                    htmlalldata += "<p class='name-text'>400分钟</p>";
                    htmlalldata += "<span>" + priceTH + "元/月</span>";
                    htmlalldata += "</div>";

                } else {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeTH' value='" + codeTH + "'>";
                    htmlalldata += "<input type='hidden' value='" + codeTH + "' name='divbeforeTH'>";
                    htmlalldata += "<p class='name'>语音：</p>";
                    htmlalldata += "<p class='name-text'>" + valueTH + "</p>";
                    htmlalldata += "<span>" + priceTH + "元/月</span>";
                    htmlalldata += "</div>";

                }


            } else {
                $("#remindid").show();
                return false;
            }


            /*短信和彩信*/
            var phonemscObj = $("input:radio[name='sel-dx']:checked");
            var phonemscVal = $("input:radio[name='sel-dx']:checked").val();
            codeDX = "";
            if (phonemscVal != null && phonemscVal != undefined) {
                codeDX = phonemscVal.split('-')[0];//短信编码
                var priceDX = phonemscVal.split('-')[1];//短信价格
                valueDX = phonemscObj.parent().find("input[name=vlauehide]").val();
            } else {
                timestp++;
                codeDX = "0";
                priceDX = "0";

            }


            var phonecolorObj = $("input:radio[name='sel-cx']:checked");
            var phonecolorVal = $("input:radio[name='sel-cx']:checked").val();
            codeCX = "";
            if (phonecolorVal != null && phonecolorVal != undefined) {
                codeCX = phonecolorVal.split('-')[0];//彩信编码
                var priceCX = phonecolorVal.split('-')[1];//彩信价格
                valueCX = phonecolorObj.parent().find("input[name=vlauehide]").val();

            } else {
                timestp++;
                var codeCX = "0";//彩信编码
                var priceCX = "0";//彩信价格


            }
            //没有选择数据业务
            if (timestp == 2) {
//                htmlalldata += "<div class='group-name1 group-name clearfix' id='beforeTotal'>";
//                htmlalldata += "<p>您没有选择数据业务</p>";
//                htmlalldata += "</div>";

            } else {
                /*选择了可选业务*/
                //短信
                if (phonemscVal != undefined && phonemscVal != "") {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeDX' value='" + codeDX + "'>";
                    htmlalldata += "<input type='hidden' value='" + codeDX + "' name='divbeforeDX'>";

                    htmlalldata += "<p class='name'>短信：</p>";
                    htmlalldata += "<p class='name-text'>" + valueDX + "</p>";
                    htmlalldata += "<span>" + priceDX + "元/月</span>";
                    htmlalldata += "</div>";
                }
                //彩信
                if (phonecolorVal != undefined && phonecolorVal != "") {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeCX' value='" + codeCX + "'>";
                    htmlalldata += "<input type='hidden' value='" + codeCX + "' name='divbeforeCX'>";

                    htmlalldata += "<p class='name'>彩信：</p>";
                    htmlalldata += "<p class='name-text'>" + valueCX + "</p>";
                    htmlalldata += "<span>" + priceCX + "元/月</span>";
                    htmlalldata += "</div>";

                }

            }

            //用户所选总价格
            var userpriceAll = parseInt(priceLL) + parseInt(priceTH) + parseInt(priceDX) + parseInt(priceCX);
            if (userpriceAll != undefined && userpriceAll != "") {
                htmlalldata += "<div class='group-name1 group-name clearfix' id='beforeTotal'>";
                htmlalldata += "<p class='tchj'>套餐合计：</p>";
                htmlalldata += "<span>" + userpriceAll + "元/月</span>";
                htmlalldata += "</div>";

                htmlalldata += "<div class='group-name1 group-name clearfix'>";
                htmlalldata += "<p class='tchj'>生效时间：";
                htmlalldata += "</p><span>次月生效</span>";
                htmlalldata += "</div>";

            }

            console.log(htmlalldata);
            $("#selectedCol").html(htmlalldata);

            $("#pageletdiv").hide();
            $("#footerbefore").hide();
            $("#zengZhiYW").hide();//增值业务
            $("#sonnConfirm").show();
            $("#footersoon").show();
            $("#incomingBusiness").show();
            $("#closeBusiness").show();


        } else {
            /*没有选择苏州语音包*/
            /*必选*/
            var phonedataObj = $("input:radio[name='sel-ll']:checked");
            var phonedataVal = $("input:radio[name='sel-ll']:checked").val();
            if (phonedataVal != "" && phonedataVal != undefined) {
                var codeLL = phonedataVal.split('-')[0];//流量编码
                var priceLL = phonedataVal.split('-')[1];//流量价格
                valueLL = phonedataObj.parent().find("input[name=vlauehide]").val();
                htmlalldata += "<div class='group-name clearfix' name='divbeforeLL'>";
                htmlalldata += "<input type='hidden' value='" + codeLL + "' name='divbeforeLL'>";

                htmlalldata += "<p class='name'>流量：</p>";
                htmlalldata += "<p class='name-text'>" + valueLL + "</p>";
                htmlalldata += "<span>" + priceLL + "元/月</span>";
                htmlalldata += "</div>";
                if (phonedataObj.parent().find("p").hasClass("hui-item")) {
                	htmlalldata += "<div class='group-name clearfix' name='divbeforeYH'>";
                    htmlalldata += "<p class='jiazeng'>加赠</p>";
                    htmlalldata += "<p class='name-text' style='line-height: 20px;'>2017优惠计划"+ valueLL +"省内通用流量+3G省内咪咕视频流量</p>";
                    htmlalldata += "<span>0元/月</span>";
                    htmlalldata += "</div>";
				}
            } else {
                $("#remindid").show();
                return false;
            }

            var phonecallObj = $("input:radio[name='sel-yy']:checked");
            var phonecallVal = $("input:radio[name='sel-yy']:checked").val();
            if (phonecallVal != "" && phonecallVal != undefined) {
                var codeTH = phonecallVal.split('-')[0];//通话编码
                var priceTH = phonecallVal.split('-')[1];//通话价格
                valueTH = phonecallObj.parent().find("input[name=vlauehide]").val();

                //针对苏州的200分钟18元
                if (codeTH == "2000007040") {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeTH'>";
                    htmlalldata += "<input type='hidden' value='" + codeTH + "' name='divbeforeTH'>";
                    htmlalldata += "<p class='name'>语音：</p>";
                    htmlalldata += "<p class='name-text'>200分钟</p>";
                    htmlalldata += "<span>" + priceTH + "元/月</span>";
                    htmlalldata += "</div>";


                    //针对苏州的400分钟28元
                } else if (codeTH == "2000007041") {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeTH'>";
                    htmlalldata += "<input type='hidden' value='" + codeTH + "' name='divbeforeTH'>";
                    htmlalldata += "<p class='name'>语音：</p>";
                    htmlalldata += "<p class='name-text'>400分钟</p>";
                    htmlalldata += "<span>" + priceTH + "元/月</span>";
                    htmlalldata += "</div>";

                } else {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeTH'>";
                    htmlalldata += "<input type='hidden' value='" + codeTH + "' name='divbeforeTH'>";
                    htmlalldata += "<p class='name'>语音：</p>";
                    htmlalldata += "<p class='name-text'>" + valueTH + "</p>";
                    htmlalldata += "<span>" + priceTH + "元/月</span>";
                    htmlalldata += "</div>";

                }

            } else {
                $("#remindid").show();
                return false;
            }


            /*短信    彩信*/
            var phonemscObj = $("input:radio[name='sel-dx']:checked");
            var phonemscVal = $("input:radio[name='sel-dx']:checked").val();
            codeDX = "";
            if (phonemscVal != null && phonemscVal != undefined) {
                codeDX = phonemscVal.split('-')[0];//短信编码
                var priceDX = phonemscVal.split('-')[1];//短信价格
                valueDX = phonemscObj.parent().find("input[name=vlauehide]").val();
            } else {
                timestp++;
                codeDX = "0";
                priceDX = "0";

            }

            var phonecolorObj = $("input:radio[name='sel-cx']:checked");
            var phonecolorVal = $("input:radio[name='sel-cx']:checked").val();
            codeCX = "";
            if (phonecolorVal != null && phonecolorVal != undefined) {
                codeCX = phonecolorVal.split('-')[0];//彩信编码
                var priceCX = phonecolorVal.split('-')[1];//彩信价格
                valueCX = phonecolorObj.parent().find("input[name=vlauehide]").val();

            } else {
                timestp++;
                var codeCX = "0";//彩信编码
                var priceCX = "0";//彩信价格


            }

            //没有选择数据业务
            if (timestp == 2) {
//                htmlalldata += "<div class='group-name1 group-name clearfix' id='beforeTotal'>";
//                htmlalldata += "<p>您没有选择数据业务</p>";
//                htmlalldata += "</div>";
            } else {
                /*选择了可选业务*/
                //短信
                if (phonemscVal != undefined && phonemscVal != "") {
                    htmlalldata += "<div class='group-name clearfix' name='divbeforeDX'>";
                    htmlalldata += "<input type='hidden' value='" + codeDX + "' name='divbeforeDX'>";
                    htmlalldata += "<p class='name'>短信：</p>";
                    htmlalldata += "<p class='name-text' id='beforeDX'>" + valueDX + "</p>";
                    htmlalldata += "<span>" + priceDX + "元/月</span>";
                    htmlalldata += "</div>";
                }
                //彩信
                if (phonecolorVal != undefined && phonecolorVal != "") {

                    htmlalldata += "<div class='group-name clearfix' name='divbeforeCX'>";
                    htmlalldata += "<input type='hidden' value='" + codeCX + "' name='divbeforeCX'>";
                    htmlalldata += "<p class='name'>彩信：</p>";
                    htmlalldata += "<p class='name-text'>" + valueCX + "</p>";
                    htmlalldata += "<span>" + priceCX + "元/月</span>";
                    htmlalldata += "</div>";

                }

            }


            //用户所选总价格
            var userpriceAll = parseInt(priceLL) + parseInt(priceTH) + parseInt(priceDX) + parseInt(priceCX);
            if (userpriceAll != undefined && userpriceAll != "") {

                htmlalldata += "<div class='group-name1 group-name clearfix' id='beforeTotal'>";
                htmlalldata += "<p class='tchj'>套餐合计：</p>";
                htmlalldata += "<span>" + userpriceAll + "元/月</span>";
                htmlalldata += "</div>";

                htmlalldata += "<div class='group-name1 group-name clearfix'>";
                htmlalldata += "<p class='tchj'>生效时间：";
                htmlalldata += "</p><span>次月生效</span>";
                htmlalldata += "</div>";

            }

            $("#selectedCol").html(htmlalldata);

            $("#pageletdiv").hide();
            $("#footerbefore").hide();
            $("#zengZhiYW").hide();//增值业务
            $("#sonnConfirm").show();
            $("#footersoon").show();
            $("#incomingBusiness").show();
            $("#closeBusiness").show();

        }

        
        //用户勾选的增值业务显示
        var finalProName = new Array();
        $(".radio").each(function () {
            if ($(this).hasClass("cur")) {
            	finalProName.push($(this).parent().parent().find("td:eq(0)").html());
            }
        });
        if (finalProName != null && finalProName.length > 0) {
			var content = '<div class="sbox-head">即将开通的套餐和业务:</div>';
			content += '<div class="sbox-body" style="padding:0">';
			content += '<table class="opensoon-table">';
			content += '<colgroup><col width="55%"/><col width="45%"/>';
//			content += '<tr><th>即将开通</th><th>开通时间</th></tr>';
			for ( var i = 0; i < finalProName.length; i++) {
				content += '<tr>';
				content += '<td>'+ finalProName[i] +'</td>';
				content += '<td>'+ $("#timenextmonth").val() +'</td>';
				content += '</tr>';
			}
			content += '</table></div>';
			$("#incomingBusiness").html(content);
		}
        

    },

    //返回上一步
    comebefore: function () {
        //插码点击二次确认按钮 modify by Wmerake 2016-06-06
        Webtrends.multiTrack({
            args: {"WT.si_n": "ZXTC", "WT.si_s": "", "WT.si_x": "-22","WT.mobile" : $("#mobile").val()}
        });
        $("#pageletdiv").show();
        $("#footerbefore").show();
        $("#zengZhiYW").show();//增值业务
        $("#sonnConfirm").hide();
        $("#footersoon").hide();
        $("#incomingBusiness").hide();
        $("#closeBusiness").hide();
    },

    //切换通用的语音包
    comebeforeTY: function () {
        var suzhoutishihtml = "";
        $("#suzhoutishi").html(suzhoutishihtml);
        $("#suzhoutishi").hide();
    },
    //切换苏州的语音包
    comebeforeSZ: function () {
        $("#suzhoutishi").show();
    },

    //所有地区变更首页价格
    changePriceshowLL: function () {

        var priceselector = $("#selitem-8u input[name='sel-yy']");
        $("#selitem-8u").show();
        var phonecallValSZ = $("input:radio[name='sel-localyy']:checked").val();
        //有选择针对苏州的语音包
        if (phonecallValSZ != "" && phonecallValSZ != undefined) {

            //去除公用的语音通话选择
            $("input:radio[name='sel-yy']:checked").attr("checked", false);
            //获取各个类型的资费
            var phonedataVal = $("input:radio[name='sel-ll']:checked").val();
            //苏州特殊
            var phonecallValSZ = $("input:radio[name='sel-localyy']:checked").val();

            //50分钟18元资费为0.25  其它0.19
             if (phonecallVal == "2000007543-8") {
                 $("#yyLabel").html("赠送来电显示，超出后0.25元/分钟");
            
             } else {
                $("#yyLabel").html("赠送来电显示，超出后0.19元/分钟");
             }

            var phonemscVal = $("input:radio[name='sel-dx']:checked").val();
            var phonecolorVal = $("input:radio[name='sel-cx']:checked").val();
            var priceLL = phonedataVal.split('-')[1];//流量价格
            var priceTHSZ = phonecallValSZ.split('-')[1];//通话价格

            var priceTHSZcode = phonecallValSZ.split('-')[0];
            suzhouhtmlshow = "";
            //18档次
            if (priceTHSZcode == "2000007040") {
                suzhouhtmlshow += "<div class='group-name1 group-name clearfix' id='beforeTotal'>";
                suzhouhtmlshow += "<p>限自选套餐流量包50元档及以上套餐档次开通</p>";
                suzhouhtmlshow += "</div>";
                $("#suzhoutishi").html(suzhouhtmlshow);
            }
            //28档次
            if (priceTHSZcode == "2000007041") {
                suzhouhtmlshow += "<div class='group-name1 group-name clearfix' id='beforeTotal'>";
                suzhouhtmlshow += "<p>限自选套餐流量包70元档及以上套餐档次开通</p>";
                suzhouhtmlshow += "</div>";
                $("#suzhoutishi").html(suzhouhtmlshow);

            }


            priceDX = "";
            if (phonemscVal != null && phonemscVal.length > 0) {
                priceDX = phonemscVal.split('-')[1];//短信价格
            } else {
                priceDX = "0";

            }

            priceCX = "";
            if (phonecolorVal != null && phonecolorVal.length > 0) {
                priceCX = phonecolorVal.split('-')[1];//彩信价格
            } else {
                priceCX = "0";//彩信价格

            }

            var htmlnowprice = "";
            var userpriceAll = parseInt(priceLL) + parseInt(priceTHSZ) + parseInt(priceDX) + parseInt(priceCX);
            htmlnowprice += "<p class='p1'><span id='nowzifei'>资费：" + userpriceAll + "元/月</span></p>";
            htmlnowprice += "<p class='p2'>次月生效</p>";
            $("#nowzifei").html(htmlnowprice);

            //没有选择针对苏州的语音包
        } else {
            //获取各个类型的资费
            var phonedataVal = $("input:radio[name='sel-ll']:checked").val();
            var phonecallVal = $("input:radio[name='sel-yy']:checked").val();

            //Modified by Wmerake on 2016-07-12 添加八元语音套餐（只有20元流量和30元流量可以选八元语音套餐）
            if (phonedataVal != "2000007351-20" && phonedataVal != "2000003990-30" && phonedataVal != "2000003785-50") {
                // $("#selitem-18u input[name='sel-yy']").attr("checked",true);
                $("#selitem-8u").hide();
                if (priceselector.prop("checked")) {
                    priceselector.prop("checked", false);
                    $("#selitem-18u input[name='sel-yy']").prop("checked", true);
                    //此处刷新默认选中后刷新语音通话价格
                    phonecallVal = $("input:radio[name='sel-yy']:checked").val();
                }
            } else {
                $("#selitem-8u").show();
                // $("#selitem-8u input[name='sel-yy']").attr("checked",true);
            }



            //50分钟18元资费为0.25  其它0.19
            // if (phonecallVal == "2000007352-18-50" || phonecallVal == "2000007352-18") {
            //     $("#yyLabel").html("赠送来电显示，超出后0.25元/分钟");
            //
            if (phonecallVal == "2000007543-8") {
                 $("#yyLabel").html("赠送来电显示、国内主叫0.25元/分钟");
             } else {
                $("#yyLabel").html("赠送来电显示，超出后0.19元/分钟");
             }

            var phonemscVal = $("input:radio[name='sel-dx']:checked").val();
            var phonecolorVal = $("input:radio[name='sel-cx']:checked").val();
            var priceLL = phonedataVal.split('-')[1];//流量价格
            var priceTH = phonecallVal.split('-')[1];//通话价格

            priceDX = "";
            if (phonemscVal != null && phonemscVal.length > 0) {
                priceDX = phonemscVal.split('-')[1];//短信价格
            } else {
                priceDX = "0";

            }

            priceCX = "";
            if (phonecolorVal != null && phonecolorVal.length > 0) {
                priceCX = phonecolorVal.split('-')[1];//彩信价格
            } else {
                priceCX = "0";//彩信价格
            }

            var htmlnowprice = "";
            var userpriceAll = parseInt(priceLL) + parseInt(priceTH) + parseInt(priceDX) + parseInt(priceCX);
            htmlnowprice += "<p class='p1'><span id='nowzifei'>资费：" + userpriceAll + "元/月</span></p>";
            htmlnowprice += "<p class='p2'>次月生效</p>";
            $("#nowzifei").html(htmlnowprice);

        }


    },

    changesure: function () {
        $("#remindid").hide();

    },

    //开通自选套餐
    opentc: function (obj) {
        $("#loadingBody").show();//蒙层
        $(obj).removeAttr("onclick");//只可点击一次办理
        var html = "";
        //必选
        var nowcodeLLobj = $(".selectedCol").find("div[name=divbeforeLL]").val();
        llval = "";
        yyval = "";
        dxval = "";
        cxval = "";

        //此处针对插码而设置 modify by Wmerake 2016-06-06
        typeLL = "";
        typeYY = "";
        typeDX = "";
        typeCX = "";



        if (document.getElementById("selectedCol")) {
            var objVal = $("#selectedCol");

            llval = objVal.find("div[name=divbeforeLL]").find("input[name=divbeforeLL]").val();//流量

            yyval = objVal.find("div[name=divbeforeTH]").find("input[name=divbeforeTH]").val();//语音

            dxval = objVal.find("div[name=divbeforeDX]").find("input[name=divbeforeDX]").val();//短信

            cxval = objVal.find("div[name=divbeforeCX]").find("input[name=divbeforeCX]").val();//彩信

            typeLL = objVal.find("div[name=divbeforeLL]").find("input[name=divbeforeLL]").parent().find(".name-text").text();
            typeLL = "LL" + typeLL;

            typeYY = objVal.find("div[name=divbeforeTH]").find("input[name=divbeforeTH]").parent().find(".name-text").text();
            typeYY = "YY" + typeYY.replace("分钟", "m");

            typeDX = objVal.find("div[name=divbeforeDX]").find("input[name=divbeforeDX]").parent().find(".name-text").text();

            if (typeDX == '')
                typeDX = "DX0";
            else
                typeDX = "DX" + typeDX.replace("条", "ti");

            typeCX = objVal.find("div[name=divbeforeCX]").find("input[name=divbeforeCX]").parent().find(".name-text").text();

            if (typeCX == '')
                typeCX = "CX0";
            else
                typeCX = "CX" + typeCX.replace("条", "ti");

            //插码点击二次确认按钮 modify by Wmerake 2016-06-06
            Webtrends.multiTrack({
                args: {
                    "WT.si_n": "ZXTC",
                    "WT.si_s": typeLL + "_" + typeYY + "_" + typeDX + "_" + typeCX,
                    "WT.si_x": "22",
                    "WT.mobile" : $("#mobile").val()
                }
            });

        }

        //勾选的增值业务
        var finalGx = new Array();
        var finalProId = new Array();
        var finalProIdchan = "";
        zzywbx = "";
        if (document.getElementById("zzywValueid")) {
            zzywbx = $("#zzywValueid").val();
        }

        //如果有可勾选的

        $(".radio").each(function () {
            if ($(this).hasClass("cur")) {
                finalProId.push($(this).attr('value'));
                    }
        });
        // var trslen = trs.length + 1;
        // for (var i = 1; i < trslen; i++) {
        //     if ($("#TT" + i).is(':checked')) {
        //         finalGx.push($("#TT" + i));
        //         var proNoId = $("#TT" + i).val();
        //         finalProId.push(proNoId);
        //
        //     }
        // }

        //存在勾选的增值业务
        if (finalProId.length > 0) {
            for (var i = 0; i < finalProId.length; i++) {
                finalProIdchan += finalProId[i] + ",";

            }
        }
//		alert("增值业务串:"+finalProIdchan);

        $.busiReq({
            data: {
                "reqUrl": "zxtcTrans",

                "typeLL": typeLL,
                "typeYY": typeYY,
                "typeDX": typeDX,
                "typeCX": typeCX,

                "busiNum": "ZXTC",
                "CodeLL": llval,
                "CodeYY": yyval,
                "CodeSJYW": dxval,
                "CodeSJYW_CX": cxval,
                "finalProIdchan": finalProIdchan,
                "zzywbx": zzywbx,
                "isConfirm": "1",
                "resultCommon": "0",
                "isSms": "1",
                "chooseFlag": "1",
                "operType": "1",
                "zzdChannel" :component.zzdChannel,
                "jobMobile"  :component.jobMobile,
                "jobNumber"  :component.jobNumber
            },
            success: function (ret) {
            	
            	var paramers = {}; 
            	 paramers.moduleID = "WAP_ZXTC";//业务名称
                 paramers.activityID = "WAP_ZXTC";//结束 时间
                 paramers.pageVID="ZXTC";//业务名称
                 paramers.pageCode="ZXTC";//业务名称
                 paramers.userType = $("#mobile").val();//手机号 0访客
                 paramers.userLabel = $("#mobile").val();//手机号
                 paramers.userGroup = "0";//用户地市
                 paramers.prizeID = typeLL;
            	
            	
            	//展示处理结果
            	var systemCode = ret.systemCode;
                if (systemCode == "-200372" || systemCode == "-200373") {
                	
                	
                	Webtrends.multiTrack({
                        args: {
                            "WT.si_n": "ZXTC",
                            "WT.si_s": typeLL + "_" + typeYY + "_" + typeDX + "_" + typeCX,
                            "WT.si_x": "-98",
                            "WT.mobile" : $("#mobile").val()
                        }
                    });
                	 
                	
                	//大数据用的插码
                	paramers.procType="0";//1成功 0失败
                	doUserLogs(paramers);
                	
                    if (systemCode == "-200372") {
                        html += "<p>您没有选择必选套餐！无法变更为自选套餐。</p>";
                    }
                    if (systemCode == "-200373") {
                        html += "<p>您无法开通该套餐！</p>";
                    }

                } else {
            	
	                if (ret && ret.resultCode == "0") {
	                	
                        
                        //插码点击二次确认按钮 modify by Wmerake 2016-06-06
//                        Webtrends.multiTrack({
//                            args: {
//                                "WT.si_n": "ZXTC",
//                                "WT.si_s": typeLL + "_" + typeYY + "_" + typeDX + "_" + typeCX,
//                                "WT.si_x": "99",
//                                "WT.mobile" : $("#mobile").val()
//                            }
//                        });
                        
                        //大数据用的插码
//	                	paramers.procType="1";//1成功 0失败
//                        doUserLogs(paramers);
                        
                        $('#bljgForm').find("input[name='busiCode']").val(typeLL + "_" + typeYY + "_" + typeDX + "_" + typeCX);
                        html += "<p>您已成功变更为【自选套餐】业务！次月生效。<br/><a style='color:blue' href='http://wap.js.10086.cn/wquestionnaire?type=1&queryParam=TCBLQR'>快来评价掌厅服务，猛戳这里即可把您的意见和建议告诉我们！</a></p>";
                        smsValidatorComponent.sendSuccessMessage("ZXTC","您已成功变更为【自选套餐】业务！次月生效。","1","");
 		    		      return;
	                    
	                    //失败
	                } else {
	                	
	                	
	                    //插码点击二次确认按钮 modify by Wmerake 2016-06-06
	                    Webtrends.multiTrack({
	                        args: {
	                            "WT.si_n": "ZXTC",
	                            "WT.si_s": typeLL + "_" + typeYY + "_" + typeDX + "_" + typeCX,
	                            "WT.si_x": "-99",
	                            "WT.mobile" : $("#mobile").val()
	                        }
	                    });
	                    
	                    //大数据用的插码
	                    paramers.procType="0";//1成功 0失败
	                    doUserLogs(paramers);
	                    
	                    var busiNum = "ZXTC";
	                    var busiName = "自选套餐";
	                    var mobile = $.trim($("#mobile").val());
	                    var userAreaNum = $.trim($("#userAreaNum").val());
	
	                    //if(userAreaNum == "17" || userAreaNum == "11") {
	                         html += "您当前的套餐不支持办理自选套餐，我们正在积极优化，<a href=\"GPRS4G.html\">点击还有更多套餐选择</a>";
	                         var buttons="<a href='ZXTC.thtml?ref_pageid=KD&ref_uuid=A002A312FC1A4FAD96A5DADEDB39C0EE' class='grey'>取消</a><a href=\"javascript:void(0);\" onclick=\"javascript:ZZD.goZZD('"+busiNum+"','"+busiName+"','"+mobile+"')\" class='blue'>咨询下营业厅</a>";
	                     	 $("#warningk").find(".btn").remove();
	                     	 $("#warningk").append(buttons);
	//                    }else{
	//                    	
	//                    	 html += "您当前的套餐不支持办理自选套餐，我们正在积极优化，<a href=\"GPRS4G.html\">点击还有更多套餐选择</a>";	
	//                    }
	                    }

	                }
                $("#zuizhongtankuang").find("p").empty();
                $("#zuizhongtankuang").find("p").append(html);
                $("#zuizhongtankuang").show();


            }
        });
    }


}